package com.itheima.mybatis_plus.controller;
import com.itheima.mybatis_plus.entity.Student;
import com.itheima.mybatis_plus.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @RequestMapping("list")
    public List<Student> listAll() {
        List<Student> students = studentService.listAll();
        System.out.println(students);
        return students;
    }


}